import CryptoJS from 'crypto-js'

const SECRETKEY = 'WEB_ADMIN_CLF'

/**
 * 加密
 * @param word 
 * @returns 
 */
export const encrypt = (word: string) => {
    return CryptoJS.AES.encrypt(word, SECRETKEY).toString();
}


/**
 * 解密
 * @param word 
 * @returns 
 */
export const decrypt = (word: string) => {
    const bytes = CryptoJS.AES.decrypt(word, SECRETKEY);
    const originalText = bytes.toString(CryptoJS.enc.Utf8);
    return originalText
}